//
//  HttpUtil.m
//  EpointFrameCore
//
//  Created by 李亚春 on 13-12-5.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "HttpUtil.h"
#import "ASIDataDecompressor.h"
#import "ASIHTTPRequest.h"

@implementation HttpUtil

+(NSString *)getZipStr:(NSString *)url
{
    NSData *decompressData = [ASIDataDecompressor uncompressData:[self getData:url] error:nil];
    NSString *bs = [[NSString alloc] initWithData:decompressData encoding:NSUTF8StringEncoding];
    return bs;
}

+(NSString *)getStr:(NSString *)url
{
    return [[NSString alloc] initWithData:[self getData:url] encoding:NSUTF8StringEncoding];
}

+(NSData *)getData:(NSString *)url
{
    ASIHTTPRequest *asRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
    [asRequest startSynchronous];
    NSData *responseData = [asRequest responseData];
    return responseData;
}

@end
